import request from '@/utils/request'

// 查询商城拼团活动列表
export function listPintuan(query) {
  return request({
    url: '/manager/promotion/pintuan/list',
    method: 'get',
    params: query
  })
}

// 查询商城满减详细
export function getPintuan(id) {
  return request({
    url: '/manager/promotion/pintuan/' + id,
    method: 'get'
  })
}

// 新增商城满减活动
export function addPintuan(data) {
  return request({
    url: '/manager/promotion/pintuan',
    method: 'post',
    data: data
  })
}

// 修改商城满减活动
export function updatePintuan(data) {
  return request({
    url: '/manager/promotion/pintuan',
    method: 'put',
    data: data
  })
}

// 删除商城满减活动
export function delPintuan(id) {
  return request({
    url: '/manager/promotion/pintuan/' + id,
    method: 'delete'
  })
}

// 启用商城满减活动
export function enablePintuan(id) {
  return request({
    url: '/manager/promotion/pintuan/enable/' + id,
    method: 'post'
  })
}

// 关闭商城优惠券
export function closePintuan(ids) {
  return request({
    url: '/manager/promotion/pintuan/close/' + ids,
    method: 'post'
  })
}
